1. Field of the Invention
The present invention relates to cryptographic methods used in electronic communications, particularly over a computer network, and more particularly to hash functions using elliptic curve cryptography for digital signatures, authentication, and other applications where hash functions are appropriate.
2. Description of the Related Art
“One-way” hash functions are cryptographic constructs used in numerous cryptographic applications. One-way hash functions are typically used with public-key algorithms for both encryption and the formation of digital signatures. These hash functions may also be used in the fields of integrity checking, authentication, and in numerous other fields.
Hash functions receive a block of data as input, and produce a “hash” or “message digest” as output. Typically, the hash acts as a signature for the original data without revealing its contents. Thus, it is important that the hash function be irreversible, i.e., not only should it be nearly impossible to retrieve the original data, but it must also be impossible to construct a data block that matches some given hash value.
Randomness, which is typically a cornerstone in cryptographic algorithms, is not typically included in hash functions, which tend to be completely deterministic in nature. Given the exact same input twice, a proper hash function should always produce the same output. Even a single bit changed in the input should produce a different hash value. Ideally, the hash value should be small enough to be manageable in further manipulations, yet large enough to prevent an attacker from randomly finding a block of data that produces the same hash.
Hash functions are not used directly for encryption, but are often very useful for authentication. One of the simplest, and most common, uses of hash functions is to protect passwords. UNIX systems, in particular, apply a hash function to a user's password and store the hash value, rather than storing the password itself. In order to authenticate the user, a password is requested, and the response runs through the hash function. If the resulting hash value is the same as the stored value, then the user must have supplied the correct password and is authenticated. Since the hash function is irreversible, obtaining the hash values does not reveal the passwords to an attacker.
As noted above, another common application of hash functions is in the formation of digital signatures. Because asymmetric cryptographic algorithms are relatively slow and can only encrypt blocks smaller than their key size, when computing digital signatures it is common to sign a cryptographically strong message digest rather than the whole message. Such message digests are obtained by applying a secure hash function. Signing just the message digest is equally valid as signing the entire message due to the particular properties of hash functions, which are described in greater detail below.
Hash functions may further be used to generate data signatures when both the sender and recipient of a data message share a secret value. By combining the data message with the secret value, and running the message through a hash function, a signature is generated in the form of the hash value. The data message is then transmitted along with the signature. The recipient then combines the received message with the secret value, generates a hash value, and checks to make sure the value is identical to the signature, thus verifying the authenticity of the message.
From the above, it is obvious that hash functions must exhibit strong security properties in order to ensure that they do not degrade the security of the whole system of which they are part. A hash is typically viewed simply as an encoded value H(m), representing the integrity of a value m. A hashing algorithm takes a string of bits as input and converts the string into a smaller string of bits, called the “hash value”. Since the input space is greater than the output space, there exists the possibility that two or more elements of the input space map to one element of the output space. The uniform distribution property minimizes such collisions, i.e., the number of collisions or corresponding m values for each hash value H(m) should be equal. Hash functions are used because they are essentially collision-free, thus making it virtually impossible to find two messages that hash to the same hash value.
Thus, hash functions must be cryptographically secure, meaning that they exhibit the following properties. First, the hash functions follow one-way or “pre-image” resistance, i.e., for a given hash code h, it is impossible to find an m where H(m)=h. This is considered one-way, because it is impractical to determine what input corresponds to a given output. One-way functions imply that it is relatively easy to take a message and compute the hash value, but that it is a relatively computationally difficult problem to take a hash value and re-create the original message. In other words, it is computationally infeasible to find a message that has a given message digest.
Second, hash functions exhibit “weak collision” or “second pre-image” resistance, i.e., it is relatively computationally difficult to find two messages that have the same message digest. Given this, it is then impossible to find, given a message, another message with the same message digest, i.e., the message digest is a good replacement for the message for the purposes of digital signature computation. Thus, hash functions should have uniform distribution.
Third, hash functions exhibit “strong collision” resistance, i.e., it is infeasible to find a pair (m1, m2) so that H(m1)=H(m2). This implies that similar hash keys should be hashed to very different hash results. Ideally, a single bit change in the hash key should influence all bits of the hash result.
Current hash functions produce a message digest of fixed length n for a message of arbitrary length. When using a good hash function, in the sense of its output appearing random, the only way to break the hash is by testing a large number of messages. To find a message with a given message digest, one will have to try approximately 2″ messages, or 2n/2 messages, to find two messages with the same message digest. It is presently considered to be possible to search 232 messages with today's technology, but not 264. Thus, n=128 is chosen for current hash functions.
Of presently existing hash functions, one set of widely used dedicated hash functions are the MDx hash functions, which were initially developed as a set of dedicated hash functions called MD4. Subsequent to that, a group of dedicated hash functions were created that were all based on similar design ideas to MD4. Several other algorithms have been derived from MD4 (with improved strength), which are typically referred to as the MDx-class. Included in the MDx-class are the MD5 algorithm, the SHA algorithms, and the RIPEMD algorithms. These hash functions are the most popular in present use, due to their performance and due to the trust gained from cryptanalytic efforts.
The design principles of the hash functions of the MDx-class are sequential and iterated constructions, where the hashing is based on the iteration of a compression function, taking a chaining variable and a message block as inputs and producing a new value for the chaining variable as output. The lengths of the chaining variable and the hash result are equal (c=n bits). Further, the hash result is taken as the final value of the chaining variable, obtained after the last application of the compression function. Thus, there is no output transformation. An initial value is defined for the chaining variable, and the message to be hashed is first preprocessed by adding some padding bits and dividing it in blocks of equal length (b bits).
The algorithms in the MDx class of algorithms include the following properties. The algorithms allow for message preprocessing, a message expansion procedure, the length of the message bit string, the message block size and, thus, the number of message words and word length, the number of chaining variables, the number of sequential steps, the number of rounds, the Boolean functions used in each round, additive constants, sub-word rotation of one or more of the chaining variables, shuffling of the chaining variables, and shuffling of the message words at each step and round.
The elaborate structure of the MDx class of hash algorithms is used in order for the resultant algorithm to be collision resistant. In general terms, MDx class algorithms resemble block ciphers, operating on a fixed initial value, with the message being hashed, thus providing the subkeys for the block cipher's operation. However, the algorithms accomplish more than just this, and must do so, because it is trivial with DES, for example, to produce any desired value for the final output by varying the last two subkeys. Thus, collisions may be produced essentially at will for a hash function that operates in this manner.
The above weakness of the MDx family is well known, with the main problem of the MDx class of hash functions appearing to be that they are not based on a computationally difficult problem that is collision resistant.
Hash functions based on block ciphers are also well known. In order to compute a hash for a relatively very short message, a symmetric cryptographic algorithm, such as DES, can be used. UNIX uses this algorithm to verify passwords in the following manner. The first eight characters of the password in seven-bit ASCII form a 56-bit DES key used to encrypt the number zero. DES's output is the hash, and in order to verify a password, this hash is compared to the one stored in the system's password database. Hashes of larger messages may also be computed with symmetric cryptography, but this is rare.
Since some block ciphers, including DES, are very secure against someone determining the key, even when the plaintext as well as the ciphertext is known, using a document as the key to a block cipher, like DES, rather than as the plaintext input, may allow the ciphertext output to function as a secure hash.
This type of approach, but used with specially constructed block algorithms that operate on larger blocks, and with the text being hashed used as a source of subkeys rather than keys from which keys for multiple rounds are derived, is a common method of performing secure hash functions. The security of the hash function based on block ciphers is dependent upon the security of the underlying block ciphers.
The security of encrypting a sequence of message blocks using a block cipher depends on two aspects: the security of the underlying block cipher; and the effectiveness of the randomization used in reducing collision attacks when encrypting a sequence of blocks.
With regard to the security of the underlying block cipher, it is well known that encryption methods that are based on computationally hard problems, such as performing factorization or solving a discrete logarithm problem, are usually stronger than those that are not based on such problems. Integer factorization can be formulated as follows. For an integer n that is the product of two prime numbers p and q, the problem is to find the values of p and q given only n. The problem becomes more difficult for larger prime numbers. The discrete logarithm problem can be formulated as follows. Given a value g and a value y whose value is equal to gk defined over a group, find the value of k. This problem becomes more difficult for larger groups. Although the applications of integer factorization and discrete logarithm problems in designing block ciphers is known, the resulting ciphers are computationally more demanding than those currently used, such as AES.
With regard to the effectiveness of randomization and semantic security, the one-time pad is the only unconditionally semantically secure cipher presently in use. With the one-time pad, the sequence of keys does not repeat itself, i.e., it is said to have an infinite cycle. However, since the sending and the receiving correspondents must generate the same random sequence, the one-time pad is impractical because of the long sequence of the non-repeating key.
As a consequence, the keys needed to encrypt and decrypt in all private-key systems, including block ciphers, remain unchanged for every message block, or they are easily derived from one another by inference using identical random number generators at the sending and receiving correspondents. Further, these generators must be initialized to the same starting point at both correspondents in order to ensure correct encryption and decryption. This is true of all the existing block ciphers, including the RNS encryption and decryption methods described above.
Many methodologies exist for the implementation of pseudo-random number generators or adaptive mechanisms for pseudo-random generation of permutations. Such methods often include those based on tables that are used to increase randomization. However, no matter how good the randomization of the underlying generator is, it always has a finite number of states and, thus, the numbers generated by these generators have a finite cycle where a particular sequence is repeated one cycle after another. Therefore, such block ciphers are vulnerable to collision attacks, and the security of such block ciphers is ultimately dependant upon the randomness of the random number generator. The RNS encryption and decryption method described above is not an exception, and, as a consequence of this, one can conclude that semantic insecurity is inherent in all block ciphers, though with varying degrees.
In the following, existing ciphers where both the sending and the receiving correspondents have to generate the same random sequence will be referred to as “synchronized-randomization ciphers”. Synchronized-randomization is achieved under the control of a key or some form of an initialization mechanism. Starting from this initial value, the subsequent keys are easily obtained by a random number generator. Therefore, synchronized-randomization between encryption and decryption is guaranteed as long as identical random number generators are used by both correspondents, and as long as the generators at both correspondents are synchronized to start from the same initial state. Thus, no unilateral change in the randomization method is allowed in synchronized-randomization.
With regard to hash functions based on mathematically difficult or complex problems, there are two well-known computationally difficult problems that are commonly used in cryptography. These are integer factorization and the discrete logarithm problem. One common hash function relies primarily on integer factorization and uses one modular exponentiation. Once the message has been converted into a long integer, a hash of the message can be computed as Hash(x)=gx mod n, where n=p*q and both p and q are large primes that are kept secret so that factoring of the modulus n=p*q becomes computationally infeasible. This hash function is provably collision resistant. The problem with using the integer factorization problem, such as that given above, is that for robust security, integers with 1,024 bits need to be used. This is very inefficient for hash functions and the associated computations.
Methods of adapting discrete logarithm-based algorithms to the setting of elliptic curves are known. However, finding discrete logarithms in this kind of group is particularly difficult. Elliptic curve-based cryptographic algorithms can be implemented using much smaller numbers than in a finite field setting of comparable cryptographic strength. Thus, the use of elliptic curve cryptography is an improvement over finite field-based public-key cryptography. In practice, an elliptic curve group over a finite field F is formed by choosing a pair of a and b coefficients, which are elements within F. The group consists of a finite set of points P(x,y) that satisfy the elliptic curve equation F(x,y)=y2−x3−ax−b=0, together with a point at infinity, O. The coordinates of the point, x and y, are elements of F represented in N-bit strings. In the following, a point is either written as a capital letter (e.g., point P) or as a pair in terms of the affine coordinates; i.e. (x,y).
The elliptic curve cryptosystem relies upon the difficulty of the elliptic curve discrete logarithm problem (ECDLP) to provide its effectiveness as a cryptosystem. Using multiplicative notation, the problem can be described as: given points B and Q in the group, find a number k such that Bk=Q; where k is the discrete logarithm of Q to the base B. Using additive notation, the problem becomes: given two points B and Q in the group, find a number k such that kB=Q.
In an elliptic curve cryptosystem, the large integer k is kept private and is often referred to as the secret key. The point Q and the base point B are made public, and are referred to as the public key. The security of the system, thus, relies upon the difficulty of deriving the secret k, knowing the public points B and Q. The main factor that determines the security strength of such a system is the size of its underlying finite field. In a real cryptographic application, the underlying field is made so large that it is computationally infeasible to determine k in a straightforward way by computing all the multiples of B until Q is found.
At the heart of elliptic curve geometric arithmetic is scalar multiplication, which computes kB by adding together k copies of the point B. Scalar multiplication is performed through a combination of point-doubling and point-addition operations. The point-addition operations add two distinct points together and the point-doubling operations add two copies of a point together. To compute, for example, B=(2*(2*(2B)))+2B=Q, it would take three point-doublings and two point-additions.
Addition of two points on an elliptic curve is calculated as follows. When a straight line is drawn through the two points, the straight line intersects the elliptic curve at a third point. The point symmetric to this third intersecting point with respect to the x-axis is defined as a point resulting from the addition. Doubling a point on an elliptic curve is calculated as follows. When a tangent line is drawn at a point on an elliptic curve, the tangent line intersects the elliptic curve at another point. The point symmetric to this intersecting point with respect to the x-axis is defined as a point resulting from the doubling.
Table I illustrates the addition rules for adding two points (x1,y1) and (x2,y2), i.e., (x3,y3)=(x1,y1)+(x2,y2).
TABLE ISummary of Addition Rules: (x3, y3) = (x1, y1) + (x2, y2)General Equationsx3 = m2 − x2 − x1y3 = m (x3 − x1) + y1 Point Addition  m  =                    y        2            -              y        1                            x        2            -              x        1             Point Doubling (x3, y3) = 2(x1, y1)  m  =                    3        ⁢                  x          1          2                    -      a              2      ⁢              y        1             (x2, y2) = −(x1, y1)(x3, y3) = (x1, y1) + (−(x2, y2)) = O(x2, y2) = 0(x3, y3) = (x1, y1) + O = (x1, y1) =−(x1, y1)(x1, −y1)
For elliptic curve encryption and decryption, given a message point (xm,ym), a base point (xB,yB), and a given key, k, the cipher point (xC,yC) is obtained using the equation (xC,yC)=(xm,ym)+k(xB,yB).
There are two basics steps in the computation of the above equations. The first step is to find the scalar multiplication of the base point with the key, k(xB,yB). The resulting point is then added to the message point, (xm,ym) to obtain the cipher point. At the receiver, the message point is recovered from the cipher point, which is usually transmitted along with the shared key and the base point (xm,ym)=(xC,yC)−k(xB,yB).
As noted above, the x-coordinate, xm, is represented as an N-bit string. However, not all of the N-bits are used to carry information about the data of the secret message. Assuming that the number of bits of the x-coordinate, xm, that do not carry data is L, then the extra bits L are used to ensure that message data, when embedded into the x-coordinate, will lead to an xm value that satisfies the elliptic curve equation (1). Typically, if the first guess of xm is not on a curve, then the second or third try will be.
Thus, the number of bits used to carry the bits of the message data is (N−L). If the secret data is a K-bit string, then the number of elliptic curve points needed to encrypt the K-bit data is
      ⌈          K              N        -        L              ⌉    .It is important to note that the y-coordinate, ym, of the message point carries no data bits.
Given a cubic equation in x defined over a finite field, F(p), of the form:t=x3+ax+b  (1)where xεF(p) tεF(p) aεF(p) and bεF(p), then any value of x will lead to a value of tεF(p). It should be noted that t could be either a quadratic residue or a non-quadratic residue (or quadratic non-residue; the terms “non-quadratic residue” and “quadratic non-residue” are used equivalently herein). If t is a quadratic residue, it can be written as t=y2, and if t is a non-quadratic residue, it can be written as t= αy2 where α is a non-quadratic element of F(p), i.e., √{square root over ( α∉F(p). Thus, equation (1), can be written as:αy2=x3+ax+b  (2)where α=1 if t is quadratic residue, and α= α if t is non-quadratic residue.
It should be noted that for a specific coefficient a,bεF(p), when α=1, the resulting curve is an elliptic curve. However, if α= α, this leads to a twist of the elliptic curve obtained with α=1. Thus, any value of xεF(p) will lead to a point (x,√{square root over (α)}y) that is either on an elliptic curve or its twist. If α=1, the point (x,√{square root over (α)}y) is on the elliptic curve. If α= α, the point (x,√{square root over (α)}y) is on its twist.
Elliptic points can be formulated on a twist of an elliptic curve in the same fashion as they are formulated for elliptic curves. As result, elliptic curve cryptography can also be defined on twists of elliptic curves in the same manner as that described above. Equations for point addition on an elliptic curve or its twist are given in Table II below. If α=1, the equations are for point addition on an elliptic curve, and when α= α, the equations are for point addition on its twist.
TABLE IISummary of Addition Rules on elliptic curves or their twists:(x3, {square root over (α)} y3) = (x1, {square root over (α)} y1) + (x2, {square root over (α)} y2)General Equationsx3 = m2 − x2 − x1{square root over (α)}y3 = m (x3 − x1) + {square root over (α)}y1 Point Addition  m  =            α        ⁢                            y          2                -                  y          1                                      x          2                -                  x          1                     Point Doubling (x3, y3) = 2(x1, y1)  m  =                    3        ⁢                  x          1          2                    -      a              2      ⁢              α            ⁢              y        1             (x2, {square root over (α)}y2) = −(x1, {square root over (α)}y1)(x3, {square root over (α)}y3) = (x1, {square root over (α)}y1) + (−(x2, {square root over (α)}y2)) = O(x2, {square root over (α)}y2) = O(x3, {square root over (α)}y3) = (x1, {square root over (α)}y1) + O = (x1, {square root over (α)}y1) =−(x1, {square root over (α)}y1)(x1, −{square root over (α)}y1)
The encryption and decryption equations are modified accordingly to:(xC,√{square root over (α)}yC)=(xm,√{square root over (α)}ym)+k(xB,√{square root over (α)}yB)  (3);and(xm,√{square root over (α)}ym)=(xC,√{square root over (α)}yC)−k(xB,√{square root over (α)}yB)  (4).
Clearly, when α=1, equations (3) and (4) are the cryptography equations over an elliptic curve, and when α= α, equations (3) and (4) define the cryptography equations over its twist.
There is an attack method referred to as power analysis in that the secret information is decrypted on the basis of leaked information. In this attack method, changes in voltage resulting from cryptographic processing of secret information, such as DES (Data Encryption Standard) encrypted messages or the like, are measured so that the encryption process of the cryptographic processing is identified, and the secret information is inferred once the basis of the encryption process is known.
As one of the measures against power analysis attack on elliptic curve cryptosystems, an encryption method using randomized projective coordinates is used. This is an effective measure against an attack method that observes whether a specific value appears or not in scalar multiplication calculations, and inferring a scalar value from the observed result. By multiplication with a random value, the appearance of such a specific value cannot be observed or inferred.
In the above-described elliptic curve cryptosystem, attack by power analysis, such as DPA or the like, was not taken into consideration. Therefore, in order to relieve an attack by power analysis, extra calculation has to be carried out using secret information in order to weaken the dependence of the encryption process and the secret information on each other. Thus, time required for the cryptographic processing increases so that cryptographic processing efficiency is lowered.
With the development of information communication networks, cryptographic techniques have been indispensable elements for the concealment or authentication of electronic information. Efficiency in terms of computation time is a necessary consideration, along with the security of the cryptographic techniques. The elliptic curve discrete logarithm problem is so difficult that elliptic curve cryptosystems can make key lengths shorter than in Rivest-Shamir-Adleman (RSA) cryptosystems, which base their security on the difficulty of factorization into prime factors. Thus, the elliptic curve cryptosystems offer comparatively high-speed cryptographic processing with optimal security. However, the processing speed is not always high enough to satisfy smart cards, for example, which have restricted throughput or servers that have to carry out large volumes of cryptographic processing.
The pair of equations for m in Table I are referred to as “slope equations”. Computation of a slope equation in finite fields requires one finite field division. Alternatively, the slope computation can be computed using one finite field inversion and one finite field multiplication. Finite field division and finite field inversion are costly in terms of computational time because they require extensive CPU cycles for the manipulation of two elements of a finite field with a large order. Presently, it is commonly accepted that a point-doubling and a point-addition operation each require one inversion, two multiplications, a square, and several additions. At present, there are techniques to compute finite field division and finite field inversion, and techniques to trade time-intensive inversions, for relatively quicker multiplication operations through performance of the operations in projective coordinates.
In cases where field inversions are significantly more time intensive than multiplication, it is efficient to utilize projective coordinates. An elliptic curve projective point (X,Y,Z) in conventional projective (or homogeneous) coordinates satisfies the homogeneous Weierstrass equation: {tilde over (F)}(X,Y,Z)=Y2Z−X3−aXZ2−bZ3=0, and, when Z≠0, it corresponds to the affine point
      (          x      ,      y        )    =            (                        X          Z                ,                  Y          Z                    )        .  Other projective representations lead to more efficient implementations of the group operation, such as the Jacobian representations, where the triplets (X,Y,Z) correspond to the affine coordinates
      (          x      ,      y        )    =      (                  X                  Z          2                    ,              Y                  Z          3                      )  whenever Z≠0. This is equivalent to using a Jacobian elliptic curve equation that is of the form {tilde over (F)}J(X,Y,Z)=Y2−X3−aXZ4−bZ6=0.
Another commonly used projection is the Chudnovsky-Jacobian coordinate projection. In general terms, the relationship between the affine coordinates and the projection coordinates can be written as
      (          x      ,      y        )    =      (                  X                  Z          i                    ,              Y                  Z          j                      )  where the values of i and j depend on the choice of the projective coordinates. For example, for homogeneous coordinates, i=1 and j=1.
The use of projective coordinates circumvents the need for division in the computation of each point addition and point doubling during the calculation of scalar multiplication. Thus, finite field division can be avoided in the calculation of scalar multiplication,
      k    ⁡          (                                    X            B                                Z            B            i                          ,                              Y            B                                Z            B            j                              )        ,when using projective coordinates.
The last addition for the computation of the cipher point,
      (                            X          C                          Z          C          i                    ,                        Y          C                          Z          C          j                      )    ,i.e., the addition of the two points
            (                                    X            m                                Z            m            i                          ,                              Y            m                                Z            m            j                              )        ⁢                  ⁢    and    ⁢                  ⁢          k      ⁡              (                                            X              B                                      Z              B              i                                ,                                    Y              B                                      Z              B              j                                      )              ,can also be carried out in the chosen projection coordinate:
      (                            X          C                          Z          C          i                    ,                        Y          C                          Z          C          j                      )    =            (                                    X            m                                Z            m            i                          ,                              Y                          m              ⁢                                                          ⁢              1                                            Z            m            j                              )        +                  (                                            X              B                                      Z              B              i                                ,                                    Y              B                                      Z              B              j                                      )            .      It should be noted that Zm=1.
However, one division (or one inversion and one multiplication) must still be carried out in order to calculate
            X      C        =                  X        C                    Z        C        i              ,since only the affine x-coordinate of the cipher point, xC, is sent by the sender.
Thus, the encryption of (N−L) bits of the secret message using elliptic curve encryption requires at least one division when using projective coordinates. Similarly, the decryption of a single message encrypted using elliptic curve cryptography also requires at least one division when using projective coordinates.
As noted above, hash functions that are based on known mathematically difficult problems, such as the discrete logarithm problem, are more secure than those that are not based on such problems. The difficulty of using elliptic curve cryptography to develop hash functions is in the iterative and non-deterministic method needed to embed a bit string into an elliptic curve point. Further, the iterative embedding methods used in existing elliptic curve cryptography have the additional drawback of the number of iterations needed being different for different bit strings that are being embedded. As a consequence, different encryption times are needed for different blocks of bit strings. Such a data dependant encryption time is not suitable for hash functions, which require data independent hash generation time.
Thus, hash functions using elliptic curve cryptography solving the aforementioned problems is desired.